package o;

import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.util.TypedValue;

class cs {
    private static final ThreadLocal<TypedValue> ʻ = new ThreadLocal();
    private static final int[] ʼ = new int[1];
    static final int[] ʽ = new int[]{16842913};
    static final int[] ˊ = new int[]{-16842910};
    static final int[] ˋ = new int[]{16843518};
    static final int[] ˎ = new int[]{16842919};
    static final int[] ˏ = new int[]{16842908};
    static final int[] ॱ = new int[]{16842912};
    static final int[] ॱॱ = new int[]{-16842919, -16842908};
    static final int[] ᐝ = new int[0];

    public static int ˊ(Context context, int i) {
        ʼ[0] = i;
        cw ˊ = cw.ˊ(context, null, ʼ);
        try {
            int ˋ = ˊ.ˋ(0, 0);
            return ˋ;
        } finally {
            ˊ.ॱ();
        }
    }

    public static ColorStateList ˏ(Context context, int i) {
        ʼ[0] = i;
        cw ˊ = cw.ˊ(context, null, ʼ);
        try {
            ColorStateList ॱ = ˊ.ॱ(0);
            return ॱ;
        } finally {
            ˊ.ॱ();
        }
    }

    public static int ॱ(Context context, int i) {
        ColorStateList ˏ = ˏ(context, i);
        if (ˏ != null && ˏ.isStateful()) {
            return ˏ.getColorForState(ˊ, ˏ.getDefaultColor());
        }
        TypedValue ˏ2 = ˏ();
        context.getTheme().resolveAttribute(16842803, ˏ2, true);
        return ˋ(context, i, ˏ2.getFloat());
    }

    private static TypedValue ˏ() {
        TypedValue typedValue = (TypedValue) ʻ.get();
        if (typedValue != null) {
            return typedValue;
        }
        typedValue = new TypedValue();
        ʻ.set(typedValue);
        return typedValue;
    }

    static int ˋ(Context context, int i, float f) {
        int ˊ = ˊ(context, i);
        return fu.ˋ(ˊ, Math.round(((float) Color.alpha(ˊ)) * f));
    }
}
